package two.chapter_1.c1_1;

import edu.princeton.cs.algs4.StdOut;

public class Printer {

    public static void printArray(Comparable a[]){

        for (int i = 0; i < a.length; i++) {
            StdOut.print(a[i]);
        }
        StdOut.println();
    }
    public static void printArray(int a[]){

        for (int i = 0; i < a.length; i++) {

            StdOut.println(a[i]);
        }

    }
    public static void printArray(String a[]){

        for (int i = 0; i < a.length; i++) {

            StdOut.print(a[i]+" ");
        }
        StdOut.println();
    }
    public static void printArray(double a[]){

        for (int i = 0; i < a.length; i++) {

            StdOut.println(a[i]);
        }

    }
    public static void printArray(int a[][]){
        /*for (int j = 0; j < a[0].length; j++) {
            StdOut.print(" "+j);
        }*/
        StdOut.print("\n");
        for (int i = 0; i < a.length; i++) {
            //StdOut.print(i);
            for (int j = 0; j <  a[0].length; j++) {
                //StdOut.print("列号："+j);
               /* if (booleans[i][j]){
                    StdOut.print("*");
                }else {
                    StdOut.print("  ");
                }*/
                StdOut.print(a[i][j]+" ");
            }
            StdOut.print("\n");
        }

    }
    public static void printArray(double a[][]){
        /*for (int j = 0; j < a[0].length; j++) {
            StdOut.print(" "+j);
        }*/
        StdOut.print("\n");
        for (int i = 0; i < a.length; i++) {
            //StdOut.print(i);
            for (int j = 0; j <  a[0].length; j++) {
                //StdOut.print("列号："+j);
               /* if (booleans[i][j]){
                    StdOut.print("*");
                }else {
                    StdOut.print("  ");
                }*/
                StdOut.print(a[i][j]+" ");
            }
            StdOut.print("\n");
        }

    }
}
